#pragma once
#include<iostream>
using namespace std;
class Date
{
	friend istream& operator>>(istream& in, Date& d);
	friend ostream& operator<<(ostream& out, const Date& d);
public:
	Date(int year = 2000, int month = 1, int day = 1)
	{
		_year = year;
		_month = month;
		_day = day;
	}

	void print();

	int GetMonthDay(int year,int month);

	bool operator==(const Date& d);

	bool operator!=(const Date& d);

	bool operator>(const Date& d);

	bool operator<(const Date& d);

	bool operator>=(const Date& d);

	bool operator<=(const Date& d);
	
	Date& operator=(const Date& d);

	Date& operator+=(int day);

	Date operator+(int day);

	Date& operator-=(int day);

	Date operator-(int day);

	Date& operator--();

	Date operator--(int);

	Date& operator++();

	Date operator++(int);

	int operator-(const Date& d);

	Date(const Date& d)
	{
		_year = d._year;
		_month = d._month;
		_day = d._day;
	}

	~Date()
	{
		_year = 0;
		_month = 0;
		_day = 0;
	}
private:
	int _year;
	int _month;
	int _day;
};

istream& operator>>(istream& in, Date& d);

ostream& operator<<(ostream& out, const Date& d);